package com.hanliy.entity;

import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

/**
 * @author hanyulin
 * @apiNote
 *  Document(collection = "user") // 指定表为user
 * @date 2021/12/9 11:38
 */
@Document(collection = "user")
public class User {
    @Id
    private String id;
    /**
     * 字段需要索引
     */
    @Indexed
    private String username;
    private String password;

    public User(String id, String username, String password) {
        this.id = id;
        this.username = username;
        this.password = password;
    }
}
